home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13867 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: newshost.lanl.gov!usenet
  2. From: Liang Lu <llu>
  3. Newsgroups: comp.lang.c++
  4. Subject: How to initialize array of objects using non-void constructor?
  5. Date: 27 Mar 1996 17:43:33 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <4jbuo5$mcb@newshost.lanl.gov>
  8. NNTP-Posting-Host: oyt.lanl.gov
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.4 sun4c)
  13. X-URL: news:comp.lang.c++
  14.  
  15. Example:
  16.  
  17. class Table {
  18.     Table() ;
  19.     Table(int n) ;
  20. ..
  21. } ;
  22.  
  23. Table object[10] ; // default constructor are used here
  24.  
  25. But, How can I have 10 objects each with different n, i.e., how to use the
  26. second constructor for array initialization? Please email me the answer.
  27.  
  28. -- 
  29. Best Regards,
  30.  
  31.  
  32.  
  33. Liang
  34.  
  35. Liang Lu
  36. CNLS/T13
  37. MS B213
  38. Los Alamos National Laboratory
  39. Los Alamos, NM 87545
  40.  
  41. Tele: 505-665-7537
  42. Fax:  505-665-3003
  43. Email: llu@t13.lanl.gov
  44. On-line Home-page: http://t13.lanl.gov/~llu/
  45.  
  46. Direction to my office: Off Diamond Dr., turn left or right on Eniwetok Dr.,
  47. turn immediate left into a parking lot, my trailer is the only trailer at the 
  48. end of the parking lot, TA-3 SM-1543.
  49.  
  50.